package org.example.mybatis.plus.dm8.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.example.mybatis.plus.dm8.entity.Person;
import org.example.mybatis.plus.dm8.mapper.PersonMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PersonService extends ServiceImpl<PersonMapper, Person> {
    // 继承ServiceImpl可获得常用的业务方法

    @Autowired
    private PersonMapper personMapper;

    public IPage<Person> getPersonPage(int current, int size) {
        Page<Person> page = new Page<>(current, size);
        return personMapper.selectPage(page, null);
    }
}
